<?php
session_start();
if(!ob_start("ob_gzhandler")) ob_start();
?>
<html>
	<head>
		<title></title>
		<link rel = 'stylesheet' type = 'text/css' href = 'settingStyle.css'>
		<script type='text/javascript' src='jquery-1.7.js'></script>
		<script type = 'text/javascript' src = 'jquery-ui-1.8.16.custom.min.js'></script>
	</head>
		<body>
		<?php
	mysql_connect("localhost", "sapmenet_admin", "a1s2d3f4g5h6j7") or die ("Problem with datebase");
	mysql_select_db("sapmenet_users");
	if (isset($_SESSION['JID'])) 
	{
		$userID=$_SESSION['JID'];
	}
		
	
	else{
		header ('Location: ..\index.php');
		exit();
	}
		?>
		<h3>Profile settings:</h3>
		<div id = "settingsPanel">
		<div id="uploadPictureId">
		<form enctype="multipart/form-data" method="post" action="upload_script.php" >
		Choose your profile picture:
		<input name="uploaded_file" type="file"/>
		<input type="submit" value="Upload" id="submitUpload"/>
		</form>
		</div>
		<br>
		<div id="modifyFormId">
		<form method="post" action="modifyinformation.php">
		<?php
		$result=mysql_query("SELECT city, info FROM users WHERE ID={$userID}");
		while($theResult = mysql_fetch_array($result, MYSQL_NUM))
		{
		echo("<div id = 'userCity'>City: <input type='text' name='city' value='".$theResult[0]."'></div><br>");
		echo("<div id = 'introduction'>Introduce yourself: <br><textarea name='info' id='infoBox' cols='22'>".$theResult[1]."</textarea></div><br>");
		}
		?>
		<input type="submit" value="Done!" id="submitInfoButton">
		</form>
		</div>
		</div>
		<script>
		var id = "<?= $_SESSION['JID']?>";
			$(function()
{
	$("#infoBox").click(function()
		{
			$("#infoBox").css("height", "80px");
			$("#infoBox").css("width", "530px");
			$("#infoBox").css("max-width", "530px");
			$("#infoBox").css("min-width", "530px");
			$("#infoBox").css("min-height", "80px");
			$("#infoBox").css("max-height", "80px");
			$("#infoBox").css("display", "block");
			$("#infoBox").val("");
		});		
});
		</script>
		</body>
	</html>
		